package com.smartcommunity.entity.fullSearch;

import java.io.Serializable;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 全息档案-检索请求参数
 * @author yangyi
 *
 */
@ApiModel(description = "全息档案-文本检索请求参数")
@Data
public class FullSearchRequest implements Serializable {
	
	private static final long serialVersionUID = -1L;
	
	@ApiModelProperty(value="检索文本", required = false)
    private String text;
	
	@ApiModelProperty(value = "分页查询页", example = "1", required = true)
    private Integer pageNumber;
	
    @ApiModelProperty(value = "分页查询数量", example = "10", required = true)
    private Integer pageSize;
	
	@ApiModelProperty(value = "数据类型  1:实有人口  2:车辆 3:房屋  4:vid,为空则查询所有", required = false)
    private List<Integer> dataType;
	
	@ApiModelProperty(value = "图片base64", required = false)
    private String img;
	
	@ApiModelProperty(value = "图片检索阈值，小于100的数字，默认90，最小50", required = false)
    private Double threshold;

    @ApiModelProperty(value = "图片搜索返回VID条数，最大100", required = false)
    private Integer topN;

    public Double getThreshold() {
        if (null == threshold) {
            return 90D;
        }
        return threshold < 50 ? 50 : threshold;
    }

    public Integer getTopN() {
        if (null == topN) {
            return 10;
        }
        return topN > 100 ? 100 : topN;
    }
	
}
